#pragma once
class IShellBrowserImpl : public IShellBrowser,/* public ICommDlgBrowser, */public ICommDlgBrowser3, public IServiceProvider,public IOleCommandTarget
{
	DWORD m_dwRef; 
public:
	IShellBrowserImpl() :m_dwRef(0){}
	~IShellBrowserImpl();
	STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject);
	STDMETHOD_(ULONG, AddRef)() { return ++m_dwRef; }
	STDMETHOD_(ULONG, Release)(){ return --m_dwRef; }  //not heap based	
	// IServiceProvider methods  
	STDMETHOD(QueryService)(REFGUID guidService, REFIID riid, void **ppvObject);
	// IOleWindow methods  
	STDMETHOD(GetWindow)(HWND *phwnd);
	STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode);
	// *** ICommDlgBrowser methods ***
	STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv);
	STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv, ULONG uChange);
	STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv, LPCITEMIDLIST pidl);
	//// *** ICommDlgBrowser2 methods ***
	STDMETHOD(Notify)(/* [in] */ __RPC__in_opt IShellView *ppshv,/* [in] */ DWORD dwNotifyType);
	STDMETHOD(GetDefaultMenuText)(/* [in] */ __RPC__in_opt IShellView *ppshv, __RPC__out_ecount_full_string(cchMax) LPWSTR pszText,/* [in] */ int cchMax);
	STDMETHOD(GetViewFlags)(/* [out] */ __RPC__out DWORD *pdwFlags);
	// *** ICommDlgBrowser3 methods ***
	STDMETHOD(OnColumnClicked)(__RPC__in_opt IShellView *ppshv, int iColumn);
	STDMETHOD(GetCurrentFilter)(__RPC__out_ecount_full_string(cchFileSpec) LPWSTR pszFileSpec, int cchFileSpec);
	STDMETHOD(OnPreViewCreated)(__RPC__in_opt IShellView *ppshv);
	// IShellBrowser methods  
	STDMETHOD(BrowseObject)(PCUIDLIST_RELATIVE pidl, UINT wFlags);
	STDMETHOD(EnableModelessSB)(BOOL fEnable);
	STDMETHOD(GetControlWindow)(UINT id, HWND *lphwnd);
	STDMETHOD(GetViewStateStream)(DWORD grfMode, IStream **ppStrm);
	STDMETHOD(InsertMenusSB)(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths);
	STDMETHOD(OnViewWindowActive)(IShellView *ppshv);
	STDMETHOD(QueryActiveShellView)(IShellView **ppshv);
	STDMETHOD(RemoveMenusSB)(HMENU hmenuShared);
	STDMETHOD(SendControlMsg)(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret);
	STDMETHOD(SetMenuSB)(HMENU hmenuShared, HOLEMENU holemenuRes, HWND hwndActiveObject);
	STDMETHOD(SetStatusTextSB)(LPCWSTR lpszStatusText);
	STDMETHOD(SetToolbarItems)(LPTBBUTTONSB lpButtons, UINT nButtons, UINT uFlags);
	STDMETHOD(TranslateAcceleratorSB)(LPMSG lpmsg, WORD wID);

	// IOleCommandTarget methods  
	STDMETHOD(QueryStatus)(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText);
	STDMETHOD(Exec)(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
};


